<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        {{msg}}
        <button @click="add('this is my arg massage')">click</button>

        <ul>
            <li v-for="(item,index) in arr">{{item.name}}</li>
        </ul>
        <button @click="addList">append</button>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                msg: 'this is my message',
                arr: [{
                    id: 1,
                    name: 'html'
                }]
            },
            methods: {
                add(argMsg) {
                    console.log(111)
                    console.log(this.msg)
                    console.log(argMsg)

                    this.msg = argMsg
                },
                addList() {
                    this.arr.push({
                        id: new Date(),
                        name: '这是我新增加的书'
                    })
                }
            }

        })
    </script>
</body>

</html>